import javax.media.j3d.LineArray;
import javax.media.j3d.Shape3D;
import javax.vecmath.Color3f;
import javax.vecmath.Point3f;

import com.sun.j3d.utils.geometry.GeometryInfo;

public class KoordinatLinjer extends Shape3D {
	public KoordinatLinjer() {
		Point3f[] vertices = new Point3f[6];
		Color3f[] colors = new Color3f[6];
		Point3f origo = new Point3f(0.0f, 0.0f, 0.0f);

		// x
		vertices[0] = origo;
		vertices[1] = new Point3f(2.0f, 0.0f, 0.0f);
		colors[0] = new Color3f(1.0f, 0.0f, 0.0f);
		colors[1] = new Color3f(1.0f, 0.0f, 0.0f);

		// y
		vertices[2] = origo;
		vertices[3] = new Point3f(0.0f, 2.0f, 0.0f);
		colors[2] = new Color3f(0.0f, 1.0f, 0.0f);
		colors[3] = new Color3f(0.0f, 1.0f, 0.0f);

		// z
		vertices[4] = origo;
		vertices[5] = new Point3f(0.0f, 0.0f, 2.0f);
		colors[4] = new Color3f(0.0f, 0.0f, 1.0f);
		colors[5] = new Color3f(0.0f, 0.0f, 1.0f);

		LineArray la = new LineArray(6, LineArray.COORDINATES
				| LineArray.COLOR_3);
		la.setCoordinates(0, vertices);
		la.setColors(0, colors);

		this.addGeometry(la);

	}

}
